/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication13;


/**
 *
 * @author Irina
 */
public  class Controller 
{
    public void executeCommand(String InputString)
    {
        ICommandExecutor ic;
        Factory f=new Factory();
        CurrentDirectory CD=new CurrentDirectory();
        //
        String[] strOut=InputString.split(" ");
        ic=f.getComandExecutor(strOut[0]);
        if(ic!=null)
        {
            if(ic!=Cd.getInstance()){InputString=CD.TestAddress(InputString);}
            ic.execute(InputString);
        }
    }
}

